package jp.co.sn.mml.pojo.tmtkgrpd;

import jp.co.sn.mml.pojo.tmitem.Tmitem;

public class TmtkgrpdId implements java.io.Serializable { 

	//特殊グループコード
	private String tkGrpCd;
	//対象項目コード
	private Tmitem itemCd;

	/** default constructor */
	public TmtkgrpdId(){

	}

	/** full constructor */
	public TmtkgrpdId(String tkGrpCd,Tmitem itemCd){
		this.tkGrpCd = tkGrpCd;
		this.itemCd = itemCd;
	}

	//Property accessors
	public String getTkGrpCd(){
		return this.tkGrpCd;
	}

	public void setTkGrpCd(String tkGrpCd){
		this.tkGrpCd=tkGrpCd;
	}

	public Tmitem getItemCd(){
		return this.itemCd;
	}

	public void setItemCd(Tmitem itemCd){
		this.itemCd=itemCd;
	}

	public boolean equals(Object other) {
		if ((this == other))
			return true;
		if ((other == null))
			return false;
		if (!(other instanceof TmtkgrpdId))
			return false;

		TmtkgrpdId castOther = (TmtkgrpdId) other;

		return ((this.getTkGrpCd() ==  castOther.getTkGrpCd())
				||(this.getTkGrpCd()!=null && castOther.getTkGrpCd() !=null 
					&& castOther.getTkGrpCd() !=null 
					&& this.getTkGrpCd().equals(castOther.getTkGrpCd())))
			&& ((this.getItemCd() ==  castOther.getItemCd())
				||(this.getItemCd()!=null && castOther.getItemCd() !=null 
					&& castOther.getItemCd() !=null 
					&& this.getItemCd().equals(castOther.getItemCd())))
;	}

	public int hashCode() {
		int result = 17;

		result = 37 * result
				+ (getTkGrpCd() == null ? 0 : this.getTkGrpCd().hashCode());
		result = 37 * result
				+ (getItemCd() == null ? 0 : this.getItemCd().hashCode());
		return result;
	}

}